/*
 * @Author: 李一番
 * @Date: 2021-10-12 13:47:43
 * @Last Modified by: 李一番
 * @Last Modified time: 2021-10-13 09:49:38
 */
import { createStore, useStore as baseUseStore } from 'vuex'
import { App } from 'vue'
import modules from './modules'
import { IStore } from './types'

const store = createStore<IStore>({
  modules
})

export const setupStore = (app: App) => {
  app.use(store)
}

// 定义你自己的“useStore”组合函数
export function useStore() {
  return baseUseStore()
}

export default store
